CollectSourceFiles(${CMAKE_CURRENT_SOURCE_DIR} PRIVATE_SOURCES)
#set(CMAKE_CXX_FLAGS "-fpermissive")
add_executable(VideoDecoder ${PRIVATE_SOURCES})
set_target_properties(VideoDecoder PROPERTIES COMPILE_FLAGS "/EHsc")

target_link_libraries(
    VideoDecoder PRIVATE
    Poco::Foundation
    Poco::Net
    Poco::Util
    decode
    utils
)

set(BUNDLE_ID_OPTION MACOSX_BUNDLE_GUI_IDENTIFIER com.ishipcore.VideoDecoder)

set_target_properties(
  VideoDecoder PROPERTIES
  ${BUNDLE_ID_OPTION}
  MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
  MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
  MACOSX_BUNDLE TRUE
  WIN32_EXECUTABLE TRUE
  )

if(MSVC)
  set_target_properties(VideoDecoder PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE")
endif()

include(GNUInstallDirs)
install(
  TARGETS VideoDecoder
  BUNDLE DESTINATION .
  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  )